// 获取输入框元素
var userIdInput = document.getElementById("userId");
var passwordInput = document.getElementById("password");

// 获取错误提示元素
var userIdError = document.getElementById("userIdError");
var passwordError = document.getElementById("passwordError");

// 给用户ID输入框添加验证逻辑
userIdInput.addEventListener("blur", function() {
    var userId = userIdInput.value;
    if (!/^\d{8,}$/.test(userId)) {
        userIdError.textContent = "用户ID必须是至少8位的数字";
    } else {
        userIdError.textContent = "";
    }
});

// 给密码输入框添加验证逻辑
passwordInput.addEventListener("blur", function() {
    var password = passwordInput.value;
    if (password.length < 6) {
        passwordError.textContent = "密码长度不能少于6位";
    } else {
        passwordError.textContent = "";
    }
});